﻿using Ninject;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Wicresoft.EKA.MVCExtensions;
using Wicresoft.EKA.ITSM.Business;

namespace Wicresoft.EKA.ITSM.Web.WebPortal.Controllers
{
    public class InspectionRuleController : BaseController
    {
        [Inject]
        public ISMGXJPlanObject SMGXJPlanObject { get; set; }

        [Inject]
        public ISMGXJPlanRule SMGXJPlanRule { get; set; }

        [Inject]
        public override IUserInfo UserInfo { get; set; }  //每个Controller必须包含的。

        protected override void OnActionExecuting(System.Web.Mvc.ActionExecutingContext filterContext)
        {
            ((IBase)SMGXJPlanObject).UserIdentify = UserName;
            ((IBase)SMGXJPlanRule).UserIdentify = UserName;
            base.OnActionExecuting(filterContext);
        }

        protected override void Dispose(bool disposing)
        {
            ((IDisposable)SMGXJPlanObject).Dispose();
            ((IDisposable)SMGXJPlanRule).Dispose();
        }

        public ActionResult Create(string TicketID, string Name, string Type, string RowId,string Permission)
        {
            ViewBag.TicketID = TicketID;
            ViewBag.Name = Name;
            ViewBag.Type = Type;
            ViewBag.RowId = RowId;
            ViewBag.Permission = Permission;
            return View();
        }

        public ActionResult Detail()
        {
            return View();
        }
    }
}